import { Component, OnInit, ViewChild, ViewContainerRef, ComponentRef, ComponentFactoryResolver, EventEmitter } from '@angular/core';
import * as _ from 'lodash';
import { DataInTransitPageComponent } from "../../content/data-in-transit-page/data-in-transit-page.component";
@Component({
  selector: 'app-data-in-transit',
  templateUrl: './data-in-transit.component.html',
  styleUrls: ['./data-in-transit.component.scss']
})
export class DataInTransitComponent implements OnInit {

   // 模版
   @ViewChild("nqdiiDataInTransit", { read: ViewContainerRef })
   nqdiiDataInTransit: ViewContainerRef;
   dataInTransitPageComponent: ComponentRef<DataInTransitPageComponent>;
   constructor(
     public resolver: ComponentFactoryResolver,
   ) { }
 
   ngOnInit() {
     if (this.dataInTransitPageComponent && this.dataInTransitPageComponent.instance) {
       this.dataInTransitPageComponent.destroy();
     }
     const dataInTransitPageComponent = this.resolver.resolveComponentFactory(DataInTransitPageComponent);
     this.dataInTransitPageComponent = this.nqdiiDataInTransit.createComponent(dataInTransitPageComponent);
   }
}
